package org.example.servlet;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@WebServlet("/request/get")
public class RequestGet extends HttpServlet {

    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        String username = req.getParameter("username");
                              //以字符串的形式返回请求参数的值
        String password = req.getParameter("password");
        //后端控制台打印日志信息
        System.out.printf("username=%s, password=%s\n", username, password);
    }
}
